/*
 * Copyright (c) 2024 iSOFT INFRASTRUCTURE SOFTWARE CO., LTD.
 * easyAda is licensed under Mulan PubL v2.
 * You can use this software according to the terms and conditions of the Mulan PubL v2.
 * You may obtain a copy of Mulan PubL v2 at:
 *          http://license.coscl.org.cn/MulanPubL-2.0
 * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND,
 * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT,
 * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
 * See the Mulan PubL v2 for more details.
 */


#ifndef __CONFIG_H__
#define __CONFIG_H__

#define KB *(1024)
#define MB *(1024 KB)

#define CONFIG_DEBUG
#define CONFIG_WITH_FPU

#define CONFIG_ARCH_AARCH64

#define CONFIG_PAGE_SHIFT (12)
#define CONFIG_PAGE_SIZE  (1 << CONFIG_PAGE_SHIFT)

#define SLAB_MNGPGS    1
#define SLAB_MAX_SLICE (CONFIG_PAGE_SIZE >> 1)

#define CONFIG_STACK_PAGES (2)
#define CONFIG_STACK_SIZE  (CONFIG_STACK_PAGES << CONFIG_PAGE_SHIFT)

#define CONFIG_ENABLE_DPRINTF
#define CONFIG_DPRINTF_BUFSIZE (1024)

#define CONFIG_MAX_PRIORITY (64)

#define CONFIG_DEFUALT_TIMESLICE   (20)
#define CONFIG_DEFAULT_PRIORITY    (10)
#define CONFIG_PRIORITY_ROOTSERVER (8)

#define CONFIG_SMP_CORES (1)

#if CONFIG_SMP_CORES > 1
#define CONFIG_ENABLE_SMP
#define CONFIG_MULTICORE_MAX_READY_TASK_COUNT 50
#endif

#define CONFIG_DOM_NUMBER        1
#define CONFIG_START_DOMAIN      0
#define CONFIG_BALANCE_THRESHOLD (0.2)

#define CONFIG_INITIAL_CNODE_RADIX (8)
#define CONFIG_INITIAL_CNODE_COUNT (1 << CONFIG_INITIAL_CNODE_RADIX)
#define CONFIG_THREAD_CNODE_RADIX  (5)
#define CONFIG_THREAD_CNODE_COUNT  (1 << CONFIG_THREAD_CNODE_RADIX)

#define CONFIG_MAX_SECS       2
#define CONFIG_PAGE_MAX_INDEX 15
#define CONFIG_PAGE_MAX       (1 << CONFIG_PAGE_MAX_INDEX)
#define CONFIG_BUDDY_MAX_LEN  (1 << 12)

#define CONFIG_ROOTSERVER_EXEC_ADDR (0X60000000)
#define CONFIG_ROOTSERVER_RDEV_ADDR (0X50000000)
#define CONFIG_SLAB_IGNORE          (6)

#define CONFIG_IRQ_COUNT 275

#define MMU_ENABLE
#define JUMP_EL0

#define CONFIG_NEW_TIME

#ifdef MMU_ENABLE
#define LINK_CONFIG_EXEC_ADDR      (0xFFFF000080000000)
#define CONFIG_EXEC_ADDR           (0xFFFF000080000000UL)
#define CONFIG_LOAD_ADDR           (0x40000000UL)
#define CONFIG_KDEV_ADDR           (0xFFFF0000FF000000UL)
#define CONFIG_ELF_LOAD_ADDR       (0x0000000088000000UL)
#define CONFIG_PAGE_TABLE_RAM_SIZE (128 MB)
#else
#define CONFIG_LOAD_ADDR      (0x40000000UL)
#define LINK_CONFIG_EXEC_ADDR (0x80000000)
#define CONFIG_EXEC_ADDR      (0x80000000)

#define CONFIG_PAGE_TABLE_RAM_SIZE (128 MB)

#endif

#define CONFIG_KERNEL_SIZE    (0x01000000)
#define CONFIG_RS_SIZE        (0x01000000)

#define CONFIG_ROOTSERVER_LOAD_ADDR         (CONFIG_LOAD_ADDR + CONFIG_KERNEL_SIZE)
#define CONFIG_ROOTSERVER_ENTRY_ADDR         (CONFIG_ROOTSERVER_EXEC_ADDR + CONFIG_KERNEL_SIZE)

#endif
